home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / info / lispref.info-32 < prev    next >
Encoding:
GNU Info File  |  1995-09-01  |  50.4 KB  |  1,231 lines

  1. This is Info file ../../info/lispref.info, produced by Makeinfo-1.63
  2. from the input file lispref.texi.
  3.  
  4.    Edition History:
  5.  
  6.    GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU
  7. Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid
  8. Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994
  9. XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995
  10. GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp
  11. Programmer's Manual (for 19.13) Third Edition, July 1995
  12.  
  13.    Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software
  14. Foundation, Inc.  Copyright (C) 1994, 1995 Sun Microsystems, Inc.
  15. Copyright (C) 1995 Amdahl Corporation.  Copyright (C) 1995 Ben Wing.
  16.  
  17.    Permission is granted to make and distribute verbatim copies of this
  18. manual provided the copyright notice and this permission notice are
  19. preserved on all copies.
  20.  
  21.    Permission is granted to copy and distribute modified versions of
  22. this manual under the conditions for verbatim copying, provided that the
  23. entire resulting derived work is distributed under the terms of a
  24. permission notice identical to this one.
  25.  
  26.    Permission is granted to copy and distribute translations of this
  27. manual into another language, under the above conditions for modified
  28. versions, except that this permission notice may be stated in a
  29. translation approved by the Foundation.
  30.  
  31.    Permission is granted to copy and distribute modified versions of
  32. this manual under the conditions for verbatim copying, provided also
  33. that the section entitled "GNU General Public License" is included
  34. exactly as in the original, and provided that the entire resulting
  35. derived work is distributed under the terms of a permission notice
  36. identical to this one.
  37.  
  38.    Permission is granted to copy and distribute translations of this
  39. manual into another language, under the above conditions for modified
  40. versions, except that the section entitled "GNU General Public License"
  41. may be included in a translation approved by the Free Software
  42. Foundation instead of in the original English.
  43.  
  44. 
  45. File: lispref.info,  Node: Glyph Properties,  Next: Glyph Convenience Functions,  Prev: Creating Glyphs,  Up: Glyph Functions
  46.  
  47. Glyph Properties
  48. ----------------
  49.  
  50.    The following symbols have predefined meanings:
  51.  
  52. `image'
  53.      The image used to display the glyph.
  54.  
  55. `baseline'
  56.      Percent above baseline that glyph is to be displayed.
  57.  
  58. `contrib-p'
  59.      Whether the glyph contributes to the height of the line it's on.
  60.  
  61. `face'
  62.      Face of this glyph (*not* a specifier).
  63.  
  64.  - Function: set-glyph-property GLYPH PROPERTY VALUE &optional LOCALE
  65.           TAG-SET HOW-TO-ADD
  66.      This function changes a property of a GLYPH.
  67.  
  68.      For built-in properties, the actual value of the property is a
  69.      specifier and you cannot change this; but you can change the
  70.      specifications within the specifier, and that is what this
  71.      function will do.  For user-defined properties, you can use this
  72.      function to either change the actual value of the property or, if
  73.      this value is a specifier, change the specifications within it.
  74.  
  75.      If PROPERTY is a built-in property, the specifications to be added
  76.      to this property can be supplied in many different ways:
  77.  
  78.           If VALUE is a simple instantiator (e.g. a string naming a
  79.           pixmap filename) or a list of instantiators, then the
  80.           instantiator(s) will be added as a specification of the
  81.           property for the given LOCALE (which defaults to `global' if
  82.           omitted).
  83.  
  84.           If VALUE is a list of specifications (each of which is a cons
  85.           of a locale and a list of instantiators), then LOCALE must be
  86.           `nil' (it does not make sense to explicitly specify a locale
  87.           in this case), and specifications will be added as given.
  88.  
  89.           If VALUE is a specifier (as would be returned by
  90.           `glyph-property' if no LOCALE argument is given), then some
  91.           or all of the specifications in the specifier will be added
  92.           to the property.  In this case, the function is really
  93.           equivalent to `copy-specifier' and LOCALE has the same
  94.           semantics (if it is a particular locale, the specification
  95.           for the locale will be copied; if a locale type,
  96.           specifications for all locales of that type will be copied;
  97.           if `nil' or `all', then all specifications will be copied).
  98.  
  99.      HOW-TO-ADD should be either `nil' or one of the symbols `prepend',
  100.      `append', `remove-tag-set-prepend', `remove-tag-set-append',
  101.      `remove-locale', `remove-locale-type', or `remove-all'.  See
  102.      `copy-specifier' and `add-spec-to-specifier' for a description of
  103.      what each of these means.  Most of the time, you do not need to
  104.      worry about this argument; the default behavior usually is fine.
  105.  
  106.      In general, it is OK to pass an instance object (e.g. as returned
  107.      by `glyph-property-instance') as an instantiator in place of an
  108.      actual instantiator.  In such a case, the instantiator used to
  109.      create that instance object will be used (for example, if you set
  110.      a font-instance object as the value of the `font' property, then
  111.      the font name used to create that object will be used instead).
  112.      If some cases, however, doing this conversion does not make sense,
  113.      and this will be noted in the documentation for particular types
  114.      of instance objects.
  115.  
  116.      If PROPERTY is not a built-in property, then this function will
  117.      simply set its value if LOCALE is `nil'.  However, if LOCALE is
  118.      given, then this function will attempt to add VALUE as the
  119.      instantiator for the given LOCALE, using `add-spec-to-specifier'.
  120.      If the value of the property is not a specifier, it will
  121.      automatically be converted into a `generic' specifier.
  122.  
  123.  - Function: glyph-property GLYPH PROPERTY &optional LOCALE
  124.      This function returns GLYPH's value of the given PROPERTY.
  125.  
  126.      If LOCALE is omitted, the GLYPH's actual value for PROPERTY will
  127.      be returned.  For built-in properties, this will be a specifier
  128.      object of a type appropriate to the property (e.g. a font or color
  129.      specifier).  For other properties, this could be anything.
  130.  
  131.      If LOCALE is supplied, then instead of returning the actual value,
  132.      the specification(s) for the given locale or locale type will be
  133.      returned.  This will only work if the actual value of PROPERTY is
  134.      a specifier (this will always be the case for built-in properties,
  135.      but not or not may apply to user-defined properties).  If the
  136.      actual value of PROPERTY is not a specifier, this value will
  137.      simply be returned regardless of LOCALE.
  138.  
  139.      The return value will be a list of instantiators (e.g. vectors
  140.      specifying pixmap data), or a list of specifications, each of
  141.      which is a cons of a locale and a list of instantiators.
  142.      Specifically, if LOCALE is a particular locale (a buffer, window,
  143.      frame, device, or `global'), a list of instantiators for that
  144.      locale will be returned.  Otherwise, if LOCALE is a locale type
  145.      (one of the symbols `buffer', `window', `frame', or `device'), the
  146.      specifications for all locales of that type will be returned.
  147.      Finally, if LOCALE is `all', the specifications for all locales of
  148.      all types will be returned.
  149.  
  150.      The specifications in a specifier determine what the value of
  151.      PROPERTY will be in a particular "domain" or set of circumstances,
  152.      which is typically a particular Emacs window along with the buffer
  153.      it contains and the frame and device it lies within.  The value is
  154.      derived from the instantiator associated with the most specific
  155.      locale (in the order buffer, window, frame, device, and `global')
  156.      that matches the domain in question.  In other words, given a
  157.      domain (i.e. an Emacs window, usually), the specifier for PROPERTY
  158.      will first be searched for a specification whose locale is the
  159.      buffer contained within that window; then for a specification
  160.      whose locale is the window itself; then for a specification whose
  161.      locale is the frame that the window is contained within; etc.  The
  162.      first instantiator that is valid for the domain (usually this
  163.      means that the instantiator is recognized by the device [i.e. the
  164.      X server or TTY device] that the domain is on).  The function
  165.      `glyph-property-instance' actually does all this, and is used to
  166.      determine how to display the glyph.
  167.  
  168.  - Function: glyph-property-instance GLYPH PROPERTY &optional DOMAIN
  169.           DEFAULT NO-FALLBACK
  170.      This function returns the instance of GLYPH's PROPERTY in the
  171.      specified DOMAIN.
  172.  
  173.      Under most circumstances, DOMAIN will be a particular window, and
  174.      the returned instance describes how the specified property
  175.      actually is displayed for that window and the particular buffer in
  176.      it.  Note that this may not be the same as how the property
  177.      appears when the buffer is displayed in a different window or
  178.      frame, or how the property appears in the same window if you
  179.      switch to another buffer in that window; and in those cases, the
  180.      returned instance would be different.
  181.  
  182.      The returned instance will typically be an image-instance object
  183.      or a string (*this is slated to change in 19.13*), and you can
  184.      query it using the appropriate object-specific functions.  For
  185.      example, you could use `image-instance-depth' to find out the
  186.      depth (number of color planes) of a pixmap displayed in a
  187.      particular window.  The results might be different from the
  188.      results you would get for another window (perhaps the user
  189.      specified a different image for the frame that window is on; or
  190.      perhaps the same image was specified but the window is on a
  191.      different X server, and that X server has different color
  192.      capabilities from this one).
  193.  
  194.      DOMAIN defaults to the selected window if omitted.
  195.  
  196.      DOMAIN can be a frame or device, instead of a window.  The value
  197.      returned for a such a domain is used in special circumstances when
  198.      a more specific domain does not apply; for example, a frame value
  199.      might be used for coloring a toolbar, which is conceptually
  200.      attached to a frame rather than a particular window.  The value is
  201.      also useful in determining what the value would be for a
  202.      particular window within the frame or device, if it is not
  203.      overridden by a more specific specification.
  204.  
  205.      If PROPERTY does not name a built-in property, its value will
  206.      simply be returned unless it is a specifier object, in which case
  207.      it will be instanced using `specifier-instance'.
  208.  
  209.      Optional arguments DEFAULT and NO-FALLBACK are the same as in
  210.      `specifier-instance'.  *Note Specifiers::.
  211.  
  212. 
  213. File: lispref.info,  Node: Glyph Convenience Functions,  Prev: Glyph Properties,  Up: Glyph Functions
  214.  
  215. Glyph Convenience Functions
  216. ---------------------------
  217.  
  218.  - Function: glyph-image GLYPH &optional LOCALE
  219.  
  220.  - Function: set-glyph-image GLYPH SPEC &optional LOCALE TAG-SET
  221.           HOW-TO-ADD
  222.  
  223.  - Function: glyph-image-instance GLYPH &optional DOMAIN DEFAULT
  224.           NO-FALLBACK
  225.  
  226.  - Function: glyph-contrib-p GLYPH &optional LOCALE
  227.      This function returns whether GLYPH contributes to its line
  228.      height.  GLYPH and LOCALE are as in `glyph-property'.
  229.  
  230.  - Function: set-glyph-contrib-p GLYPH SPEC &optional LOCALE TAG-SET
  231.           HOW-TO-ADD
  232.  
  233.  - Function: glyph-contrib-p-instance GLYPH &optional DOMAIN DEFAULT
  234.           NO-FALLBACK
  235.  
  236.  - Function: glyph-baseline GLYPH &optional LOCALE
  237.  
  238.  - Function: set-glyph-baseline GLYPH SPEC &optional LOCALE TAG-SET
  239.           HOW-TO-ADD
  240.  
  241.  - Function: glyph-baseline-instance GLYPH &optional DOMAIN DEFAULT
  242.           NO-FALLBACK
  243.  
  244. 
  245. File: lispref.info,  Node: Images,  Next: Cursors,  Prev: Glyph Functions,  Up: Glyphs
  246.  
  247. Images
  248. ======
  249.  
  250. * Menu:
  251.  
  252. * Image Specifiers::        Specifying how an image will appear.
  253. * Image Instantiator Conversion::
  254.                 Conversion is applied to image instantiators
  255.                   at the time they are added to an
  256.                   image specifier or at the time they
  257.                   are passed to `make-image-instance'.
  258. * Image Instances::        What an image specifier gets instanced as.
  259.  
  260. 
  261. File: lispref.info,  Node: Image Specifiers,  Next: Image Instantiator Conversion,  Up: Images
  262.  
  263. Image Specifiers
  264. ----------------
  265.  
  266.    An image specifier is used for images (pixmaps and the like).  It is
  267. used to describe the actual image in a glyph.  It is instanced as an
  268. image-instance.
  269.  
  270.    An image instantiator should be a string or a vector of the form
  271.  
  272.       `[TYPE :KEYWORD VALUE ...]'
  273.  
  274.    i.e. a type symbol followed by zero or more alternating keyword-value
  275. pairs.  TYPE should be one of
  276.  
  277. `nothing'
  278.      (Don't display anything; no keywords are valid for this.)
  279.  
  280. `string'
  281.      (Display this image as a text string.)
  282.  
  283. `formatted-string'
  284.      (Display this image as a text string, with replaceable fields;
  285.      #### not implemented in 19.13.)
  286.  
  287. `xbm'
  288.      (An X bitmap; only if X support was compiled into this XEmacs.)
  289.  
  290. `xpm'
  291.      (An XPM pixmap; only if XPM support was compiled into this XEmacs.)
  292.  
  293. `xface'
  294.      (An X-Face bitmap, used to encode people's faces in e-mail
  295.      messages; only if X-Face support was compiled into this XEmacs.)
  296.  
  297. `autodetect'
  298.      (XEmacs tries to guess what format the data is in.  If X support
  299.      exists, the data string will be checked to see if it names a
  300.      filename.  If so, and this filename contains XBM or XPM data, the
  301.      appropriate sort of pixmap will be created.  Otherwise, the image
  302.      will be displayed as a string.  If no X support exists, the image
  303.      will always be displayed as a string.)
  304.  
  305.    The valid keywords are:
  306.  
  307. `:data'
  308.      (Inline data.  For most formats above, this should be a string.
  309.      For XBM images, this should be a cons of three elements: width,
  310.      height, and a string of bit data.)
  311.  
  312. `:file'
  313.      (Data is contained in a file.  The value is the name of this file.
  314.      If both `:data' and `:file' are specified, the image is created
  315.      from what is specified in `:data' and the string in `:file'
  316.      becomes the value of the `image-instance-file-name' function when
  317.      applied to the resulting image-instance.)
  318.  
  319. `:mask-data'
  320.      (Only for XBM images.  This specifies a mask to be used with the
  321.      bitmap.  The format is a cons of width, height, and bits, like for
  322.      `:data'.)
  323.  
  324. `:mask-file'
  325.      (Only for XBM images.  This specifies a file containing the mask
  326.      data.)
  327.  
  328. `:color-symbols'
  329.      (Only for XPM images.  This specifies an alist that maps strings
  330.      that specify symbolic color names to the actual color to be used
  331.      for that symbolic color (in the form of a string or a
  332.      color-specifier object).  If this is not specified, the contents
  333.      of `xpm-color-symbols' are used to generate the alist.)
  334.  
  335.    If instead of a vector, the instantiator is a string, it will be
  336. looked up according to the specs in the
  337. `device-type-image-conversion-list' for the device type of the domain
  338. over which the image is being instantiated.
  339.  
  340.    If the instantiator is a string, it will be read in at the time that
  341. the instantiator is added to the image, and the instantiator will be
  342. converted into one of the `[FILENAME ...]' forms.  This implies that
  343. the file must exist when the instantiator is added to the image, but
  344. does not need to exist at any other time (e.g. it may be a temporary
  345. file).
  346.  
  347.  - Function: image-specifier-p OBJECT
  348.      This function returns non-`nil' if OBJECT is an image specifier.
  349.  
  350.  - Variable: xpm-color-symbols
  351.      This variable holds definitions of logical color-names used when
  352.      reading XPM files.  Elements of this list should be of the form
  353.      `(COLOR-NAME FORM-TO-EVALUATE)'.  The COLOR-NAME should be a
  354.      string, which is the name of the color to define; the
  355.      FORM-TO-EVALUATE should evaluate to a color specifier object, or a
  356.      string to be passed to `make-color-instance' (*note Colors::.).  If
  357.      a loaded XPM file references a symbolic color called COLOR-NAME,
  358.      it will display as the computed color instead.
  359.  
  360.      The default value of this variable defines the logical color names
  361.      `"foreground"' and `"background"' to be the colors of the
  362.      `default' face.
  363.  
  364.  - Variable: x-bitmap-file-path
  365.      A list of the directories in which X bitmap files may be found.
  366.      If nil, this is initialized from the `"*bitmapFilePath"' resource.
  367.      This is used by the `make-image-instance' function (however, note
  368.      that if the environment variable `XBMLANGPATH' is set, it is
  369.      consulted first).
  370.  
  371. 
  372. File: lispref.info,  Node: Image Instantiator Conversion,  Next: Image Instances,  Prev: Image Specifiers,  Up: Images
  373.  
  374. Image Instantiator Conversion
  375. -----------------------------
  376.  
  377.  - Function: set-device-type-image-conversion-list DEVICE-TYPE LIST
  378.      This function sets the image-conversion-list for devices of the
  379.      given DEVICE-TYPE.  The image-conversion-list specifies how image
  380.      instantiators that are strings should be interpreted.  Each
  381.      element of the list should be a list of two elements (a regular
  382.      expression string and a vector) or a list of three elements (the
  383.      preceding two plus an integer index into the vector).  The string
  384.      is converted to the vector associated with the first matching
  385.      regular expression.  If a vector index is specified, the string
  386.      itself is substituted into that position in the vector.
  387.  
  388.      Note: The conversion above is applied when the image instantiator
  389.      is added to an image specifier, not when the specifier is actually
  390.      instantiated.  Therefore, changing the image-conversion-list only
  391.      affects newly-added instantiators.  Existing instantiators in
  392.      glyphs and image specifiers will not be affected.
  393.  
  394.  - Function: device-type-image-conversion-list DEVICE-TYPE
  395.      This function returns the image-conversion-list for devices of the
  396.      given DEVICE-TYPE.
  397.  
  398. 
  399. File: lispref.info,  Node: Image Instances,  Prev: Image Instantiator Conversion,  Up: Images
  400.  
  401. Image Instances
  402. ---------------
  403.  
  404.    Image-instance objects encapsulate the way a particular image
  405. (pixmap, etc.) is displayed on a particular device.  In most
  406. circumstances, you do not need to directly create image instances; use
  407. a glyph or an image- specifier instead. (Most functions and data
  408. structures that want an image are designed to take either a glyph or an
  409. image-specifier.)
  410.  
  411.  - Function: image-instance-p OBJECT
  412.      This function returns non-`nil' if OBJECT is an image instance.
  413.  
  414.  - Function: make-image-instance DATA &optional DEVICE FORCE-MONO
  415.           NOERROR
  416.      This function creates a new image-instance object.
  417.  
  418.  - Function: colorize-image-instance IMAGE-INSTANCE FOREGROUND
  419.           BACKGROUND
  420.      This function makes the image instance be displayed in the given
  421.      colors.  Image instances come in two varieties: bitmaps, which are
  422.      1 bit deep which are rendered in the prevailing foreground and
  423.      background colors; and pixmaps, which are of arbitrary depth
  424.      (including 1) and which have the colors explicitly specified.
  425.      This function converts a bitmap to a pixmap.  If the image
  426.      instance was a pixmap already, nothing is done (and `nil' is
  427.      returned).  Otherwise `t' is returned.
  428.  
  429.  - Function: image-instance-depth IMAGE-INSTANCE
  430.      This function returns the depth of the image instance.  This is 0
  431.      for a bitmap, or a positive integer for a pixmap.
  432.  
  433.  - Function: image-instance-file-name IMAGE-INSTANCE
  434.      This function returns the file name from which the given image
  435.      instance was read, or `nil' if the image instance was created from
  436.      Lisp data (the lisp data is not retained, since it usually won't
  437.      be needed again and might be quite large).
  438.  
  439.  - Function: image-instance-height IMAGE-INSTANCE
  440.      This function returns the height of the image instance, in pixels.
  441.  
  442.  - Function: image-instance-width IMAGE-INSTANCE
  443.      This function returns the width of the image instance, in pixels.
  444.  
  445.  - Function: set-image-instance-hotspot IMAGE-INSTANCE X Y
  446.      This function sets the image instance's hotspot.  This is a point
  447.      relative to the origin of the pixmap.  When a pixmap is used as a
  448.      cursor or similar pointing indicator, the hotspot is the point on
  449.      the pixmap that sits over the location that the pointer points to.
  450.      This is, for example, the tip of the arrow or the center of the
  451.      crosshairs.
  452.  
  453.  - Function: image-instance-hotspot-x IMAGE-INSTANCE
  454.      This function returns the X coordinate of the image instance's
  455.      hotspot.
  456.  
  457.  - Function: image-instance-hotspot-y IMAGE-INSTANCE
  458.      This function returns the Y coordinate of the image instance's
  459.      hotspot.
  460.  
  461. 
  462. File: lispref.info,  Node: Cursors,  Prev: Images,  Up: Glyphs
  463.  
  464. Cursors
  465. =======
  466.  
  467.    Cursors are scheduled to be overhauled in 19.13.  Watch this space
  468. for more info.
  469.  
  470. 
  471. File: lispref.info,  Node: Annotations,  Next: Display,  Prev: Glyphs,  Up: Top
  472.  
  473. Annotations
  474. ***********
  475.  
  476.    An "annotation" is a pixmap or string that is not part of a buffer's
  477. text but is displayed next to a particular location in a buffer.
  478. Annotations are implemented using extents (*note Extents::.); but you
  479. can work with annotations without knowing how extents work.
  480.  
  481. * Menu:
  482.  
  483. * Annotation Basics::
  484. * Annotation Primitives::
  485. * Margin Primitives::
  486. * Annotation Hooks::
  487.  
  488. 
  489. File: lispref.info,  Node: Annotation Basics,  Next: Annotation Primitives,  Up: Annotations
  490.  
  491. Annotation Basics
  492. =================
  493.  
  494.    Marginal annotations are notes associated with a particular location
  495. in a buffer.  They may be displayed in a margin created on the left-hand
  496. side of the frame, in any whitespace at the beginning of a line, or
  497. inside of the text itself.  Every annotation may have an associated
  498. action to be performed when the annotation is selected.  The term
  499. "annotation" is used to refer to an individual note.  The term "margin"
  500. is generically used to refer to the whitespace before the first
  501. character on a line.
  502.  
  503. `annotation'
  504.      Each annotation has the following characteristics:
  505.     GLYPH
  506.           This may be either a bitmap/pixmap object or a string.
  507.  
  508.     FACE
  509.           The face with which to display the glyph.
  510.  
  511.     ACTION
  512.           If non-nil this field must contain a function capable of
  513.           being the first argument to `funcall'.  This function is
  514.           evaluated with a single argument, the value of the DATA
  515.           field, each time the annotation is selected.
  516.  
  517.     DATA
  518.           Not used internally.  This field can contain any Elisp
  519.           object.  It is passed as the lone argument to ACTION
  520.           described above.
  521.  
  522.     TYPE
  523.           Valid types are: `bitmap', `pixmap' and `string'.
  524.  
  525.    The margin is divided into "outside" and "inside".  The outside
  526. margin is space on the left side of the frame which normal text cannot
  527. be displayed in.  The inside margin is that space between the leftmost
  528. point text can be displayed and where the first character actually is.
  529.  
  530.    There are four different "layout types" which affect the exact
  531. location an annotation appears.
  532.  
  533. `outside-margin'
  534.      The annotation is placed, left-justified, into the outside margin
  535.      area.  If the outside margin is not wide enough for an annotation
  536.      to fit it is not displayed.
  537.  
  538. `inside-margin'
  539.      The annotation is placed, left-justified, into the inside margin
  540.      area.  If the inside margin is not wide enough for the annotation
  541.      to fit it will be displayed using any available outside margin
  542.      space if and only if the variable `use-left-overflow' is non-`nil'.
  543.  
  544. `whitespace'
  545.      The annotation is placed, right-justified, into the inside margin
  546.      area.  This puts the annotation as close as possible to the first
  547.      non-whitespace character on a line.  If the inside margin is not
  548.      wide enough for the annotation to fit it will be displayed if and
  549.      only if the variable `use-left-overflow' is non-`nil'.
  550.  
  551. `text'
  552.      The annotation is placed at the position it is inserted.  It will
  553.      create enough space for itself inside of the text area.  It does
  554.      not take up a place in the logical buffer, only in the display of
  555.      the buffer.
  556.  
  557.    The current layout policy is that all `whitespace' annotations are
  558. displayed first.  Next, all `inside-margin' annotations are displayed
  559. using any remaining space.  Finally as many `outside-margin'
  560. annotations are displayed as possible.  The `text' annotations will
  561. always display as they create their own space to display in.
  562.  
  563. 
  564. File: lispref.info,  Node: Annotation Primitives,  Next: Margin Primitives,  Prev: Annotation Basics,  Up: Annotations
  565.  
  566. Annotation Primitives
  567. =====================
  568.  
  569.  - Function: make-annotation GLYPH &optional POSITION LAYOUT BUFFER
  570.      Create a marginal annotation with GLYPH, which may be a
  571.      bitmap/pixmap or a string at position POS.  Use layout policy
  572.      LAYOUT and place the annotation in buffer BUFFER.  If POS is
  573.      `nil', point is used.  If LAYOUT is `nil', `whitespace' is used.
  574.      If BUFFER is `nil', the current buffer is used.  Returns the newly
  575.      created annotation.
  576.  
  577.  - Function: delete-annotation ANNOTATION
  578.      Remove ANNOTATION from its buffer.  This does not modify the
  579.      buffer text.  Returns the annotation deleted.
  580.  
  581.  - Function: annotationp ANNOTATION
  582.      Return `t' if ANNOTATION is an annotation, `nil' otherwise.
  583.  
  584.  - Function: annotation-visible ANNOTATION
  585.      Return `t' if there is enough available space to display
  586.      ANNOTATION, `nil' otherwise.
  587.  
  588.  - Function: annotation-at &optional POSITION BUFFER
  589.      Return the annotation at POSITION in BUFFER.  If POSITION is `nil'
  590.      point is used.  If BUFFER is `nil' the current buffer is used.
  591.  
  592.  - Function: annotation-layout ANNOTATION
  593.      Return the layout policy of ANNOTATION.
  594.  
  595.  - Function: set-annotation-layout ANNOTATION LAYOUT
  596.      Set the layout policy of ANNOTATION to LAYOUT.
  597.  
  598.  - Function: annotation-type ANNOTATION
  599.      Returns the display type of ANNOTATION.  The type will be one of
  600.      following symbols:
  601.     `'
  602.           pixmap
  603.  
  604.     `'
  605.           bitmap
  606.  
  607.     `'
  608.           string
  609.  
  610.     `'
  611.           nil (object is not an annotation)
  612.  
  613.  - Function: annotation-width ANNOTATION
  614.      Return the width of ANNOTATION in pixels.
  615.  
  616.  - Function: annotation-glyph ANNOTATION
  617.      If ANNOTATION is of type `string' return the string.  Otherwise
  618.      return the bitmap or pixmap object of the glyph representing
  619.      ANNOTATION.
  620.  
  621.  - Function: set-annotation-glyph ANNOTATION GLYPH &optional LAYOUT
  622.      Set the glyph image of ANNOTATION to GLYPH.  If LAYOUT is
  623.      non-`nil' set the layout policy of ANNOTATION to LAYOUT.  Returns
  624.      the new value of `annotation-glyph'.
  625.  
  626.  - Function: annotation-data ANNOTATION
  627.      Return the data associated with ANNOTATION.
  628.  
  629.  - Function: set-annotation-data ANNOTATION DATA
  630.      Set the data field of ANNOTATION to DATA.  Returns DATA.
  631.  
  632.  - Function: annotation-action ANNOTATION
  633.      Return the action associated with ANNOTATION.
  634.  
  635.  - Function: set-annotation-action ANNOTATION ACTION
  636.      Set the action field of ANNOTATION to ACTION.  Returns ACTION.
  637.  
  638.  - Function: annotation-face ANNOTATION
  639.      Return the face associated with ANNOTATION.
  640.  
  641.  - Function: set-annotation-face ANNOTATION FACE
  642.      Set the face associated with ANNOTATION to FACE.
  643.  
  644.  - Function: annotations-in-region START END BUFFER
  645.      Return a list of all annotations in BUFFER which are between START
  646.      and END inclusively.
  647.  
  648.  - Function: annotation-at &optional POSITION BUFFER
  649.      Return a list of all annotations at POSITION in BUFFER.  If
  650.      POSITION is `nil' point is used.  If BUFFER is `nil' the current
  651.      buffer is used.
  652.  
  653.  - Function: annotation-list &optional BUFFER
  654.      Returns a list of all annotations in BUFFER.  If BUFFER is `nil',
  655.      the current buffer is used.
  656.  
  657.  - Function: all-annotations
  658.      Returns a list of all annotations in all buffers in existence.
  659.  
  660. 
  661. File: lispref.info,  Node: Margin Primitives,  Next: Annotation Hooks,  Prev: Annotation Primitives,  Up: Annotations
  662.  
  663. Margin Primitives
  664. =================
  665.  
  666.    It is possible to set values for both a left and a right hand side
  667. margin.  Only the left side has been implemented.  All margin settings
  668. are buffer-local at the moment.
  669.  
  670.  - Function: set-buffer-left-margin-width WIDTH &optional BUFFER
  671.      Set the width, in characters, of the left outside margin of BUFFER
  672.      to WIDTH.  If BUFFER is `nil', the current buffer is used.
  673.      Returns the new width.
  674.  
  675.  - Function: set-buffer-right-margin-width WIDTH &optional BUFFER
  676.      Set the width, in characters, of the right outside margin of
  677.      BUFFER to WIDTH.  If BUFFER is `nil', the current buffer is used.
  678.      Returns the new width.
  679.  
  680.  - Function: buffer-left-margin-width &optional BUFFER
  681.      Return the width of the left outside margin, in characters, of
  682.      BUFFER.  If BUFFER is `nil', the current buffer is used.
  683.  
  684.  - Function: buffer-right-margin-width &optional BUFFER
  685.      Return the width of the right outside margin, in characters, of
  686.      BUFFER.  If BUFFER is `nil', the current buffer is used.
  687.  
  688.  - Function: buffer-left-margin-pixwidth &optional BUFFER
  689.      Return the width of the left outside margin, in pixels, of BUFFER.
  690.      If BUFFER is `nil', the current buffer is used.
  691.  
  692.  - Function: buffer-right-margin-pixwidth &optional BUFFER
  693.      Return the width of the right outside margin, in pixels, of
  694.      BUFFER.  If BUFFER is `nil', the current buffer is used.
  695.  
  696.  - Variable: use-left-overflow
  697.      If non-`nil' use the left outside margin as extra whitespace when
  698.      displaying `whitespace' and `inside-margin' annotations.  Defaults
  699.      to `nil'.
  700.  
  701.    The margin colors are controlled by the faces `left-margin' and
  702. `right-margin'.  These can be set using the X resources
  703. `Emacs*left-margin*background' and `Emacs*left-margin*foreground'.
  704. Likewise for the right margin.
  705.  
  706. 
  707. File: lispref.info,  Node: Annotation Hooks,  Prev: Margin Primitives,  Up: Annotations
  708.  
  709. Annotation Hooks
  710. ================
  711.  
  712.    The following three hooks are provided for use with the marginal
  713. annotations:
  714.  
  715. *`before-delete-annotation-hook'*
  716.      This hook is called immediately before an annotation is destroyed.
  717.      It is passed a single argument, the annotation being destroyed.
  718.  
  719. *`after-delete-annotation-hook'*
  720.      This hook is called immediately after an annotation is destroyed.
  721.      It may contain any number of functions to run.  No arguments are
  722.      passed to any of the functions on the hook.
  723.  
  724. *`make-annotation-hook'*
  725.      This hook is called immediately after an annotation is created.
  726.      It is passed a single argument, the newly created annotation.
  727.  
  728. 
  729. File: lispref.info,  Node: Display,  Next: Processes,  Prev: Annotations,  Up: Top
  730.  
  731. Emacs Display
  732. *************
  733.  
  734.    This chapter describes a number of other features related to the
  735. display that XEmacs presents to the user.
  736.  
  737. * Menu:
  738.  
  739. * Refresh Screen::      Clearing the screen and redrawing everything on it.
  740. * Truncation::          Folding or wrapping long text lines.
  741. * The Echo Area::       Where messages are displayed.
  742. * Invisible Text::      Hiding part of the buffer text.
  743. * Selective Display::   Hiding part of the buffer text (the old way).
  744. * Overlay Arrow::       Display of an arrow to indicate position.
  745. * Temporary Displays::  Displays that go away automatically.
  746. * Blinking::            How XEmacs shows the matching open parenthesis.
  747. * Usual Display::    The usual conventions for displaying nonprinting chars.
  748. * Display Tables::    How to specify other conventions.
  749. * Beeping::             Audible signal to the user.
  750.  
  751. 
  752. File: lispref.info,  Node: Refresh Screen,  Next: Truncation,  Up: Display
  753.  
  754. Refreshing the Screen
  755. =====================
  756.  
  757.    The function `redraw-frame' redisplays the entire contents of a
  758. given frame.  *Note Frames::.
  759.  
  760.  - Function: redraw-frame FRAME
  761.      This function clears and redisplays frame FRAME.
  762.  
  763.    Even more powerful is `redraw-display':
  764.  
  765.  - Command: redraw-display &optional DEVICE
  766.      This function redraws all frames on DEVICE marked as having their
  767.      image garbled.  DEVICE defaults to the selected device.  If DEVICE
  768.      is `t', all devices will have their frames checked.
  769.  
  770.    Processing user input takes absolute priority over redisplay.  If you
  771. call these functions when input is available, they do nothing
  772. immediately, but a full redisplay does happen eventually--after all the
  773. input has been processed.
  774.  
  775.    Normally, suspending and resuming XEmacs also refreshes the screen.
  776. Some terminal emulators record separate contents for display-oriented
  777. programs such as XEmacs and for ordinary sequential display.  If you are
  778. using such a terminal, you might want to inhibit the redisplay on
  779. resumption.  *Note Suspending XEmacs::.
  780.  
  781.  - Variable: no-redraw-on-reenter
  782.      This variable controls whether XEmacs redraws the entire screen
  783.      after it has been suspended and resumed.  Non-`nil' means yes,
  784.      `nil' means no.
  785.  
  786.    The above functions do not actually cause the display to be updated;
  787. rather, they clear out the internal display records that XEmacs
  788. maintains, so that the next time the display is updated it will be
  789. redrawn from scratch.  Normally this occurs the next time that
  790. `next-event' or `sit-for' is called; however, a display update will not
  791. occur if there is input pending.  *Note Command Loop::.
  792.  
  793.  - Command: force-redisplay
  794.      This function causes an immediate update of the display in all
  795.      circumstances, whether or not input is pending. (This function does
  796.      not exist in FSF Emacs.)
  797.  
  798.  - Function: force-cursor-redisplay
  799.      This function causes an immediate update of the cursor on the
  800.      selected frame. (This function does not exist in FSF Emacs.)
  801.  
  802. 
  803. File: lispref.info,  Node: Truncation,  Next: The Echo Area,  Prev: Refresh Screen,  Up: Display
  804.  
  805. Truncation
  806. ==========
  807.  
  808.    When a line of text extends beyond the right edge of a window, the
  809. line can either be truncated or continued on the next line.  When a line
  810. is truncated, this is normally shown with a `\' in the rightmost column
  811. of the window on X displays, and with a `$' on TTY devices.  When a
  812. line is continued or "wrapped" onto the next line, this is shown with a
  813. curved arrow in the rightmost column of the window (or with a `\' on
  814. TTY devices).  The additional screen lines used to display a long text
  815. line are called "continuation" lines.
  816.  
  817.    Normally, whenever line truncation is in effect for a particular
  818. window, a horizontal scrollbar is displayed in that window if the
  819. device supports scrollbars.  *Note Scrollbars::.
  820.  
  821.    Note that continuation is different from filling; continuation
  822. happens on the screen only, not in the buffer contents, and it breaks a
  823. line precisely at the right margin, not at a word boundary.  *Note
  824. Filling::.
  825.  
  826.  - User Option: truncate-lines
  827.      This buffer-local variable controls how XEmacs displays lines that
  828.      extend beyond the right edge of the window.  If it is non-`nil',
  829.      then XEmacs does not display continuation lines; rather each line
  830.      of text occupies exactly one screen line, and a backslash appears
  831.      at the edge of any line that extends to or beyond the edge of the
  832.      window.  The default is `nil'.
  833.  
  834.      If the variable `truncate-partial-width-windows' is non-`nil',
  835.      then truncation is always used for side-by-side windows (within one
  836.      frame) regardless of the value of `truncate-lines'.
  837.  
  838.  - User Option: default-truncate-lines
  839.      This variable is the default value for `truncate-lines', for
  840.      buffers that do not have local values for it.
  841.  
  842.  - User Option: truncate-partial-width-windows
  843.      This variable controls display of lines that extend beyond the
  844.      right edge of the window, in side-by-side windows (*note Splitting
  845.      Windows::.).  If it is non-`nil', these lines are truncated;
  846.      otherwise, `truncate-lines' says what to do with them.
  847.  
  848.    The backslash and curved arrow used to indicate truncated or
  849. continued lines are only defaults, and can be changed.  These images
  850. are actually glyphs (*note Glyphs::.).  XEmacs provides a great deal of
  851. flexibility in how glyphs can be controlled. (This differs from FSF
  852. Emacs, which uses display tables to control these images.)
  853.  
  854.  - Variable: truncation-glyph
  855.      This variable holds the glyph that is displayed at the end of
  856.      truncated lines.
  857.  
  858.  - Variable: continuation-glyph
  859.      This variable holds the glyphs that is displayed at the end of
  860.      wrapped lines.
  861.  
  862. 
  863. File: lispref.info,  Node: The Echo Area,  Next: Invisible Text,  Prev: Truncation,  Up: Display
  864.  
  865. The Echo Area
  866. =============
  867.  
  868.    The "echo area" is used for displaying messages made with the
  869. `message' primitive, and for echoing keystrokes.  It is not the same as
  870. the minibuffer, despite the fact that the minibuffer appears (when
  871. active) in the same place on the screen as the echo area.  The `XEmacs
  872. Reference Manual' specifies the rules for resolving conflicts between
  873. the echo area and the minibuffer for use of that screen space (*note
  874. The Minibuffer: (emacs)Minibuffer.).  Error messages appear in the echo
  875. area; see *Note Errors::.
  876.  
  877.    You can write output in the echo area by using the Lisp printing
  878. functions with `t' as the stream (*note Output Functions::.), or as
  879. follows:
  880.  
  881.  - Function: message STRING &rest ARGUMENTS
  882.      This function displays a one-line message in the echo area.  The
  883.      argument STRING is similar to a C language `printf' control
  884.      string.  See `format' in *Note String Conversion::, for the details
  885.      on the conversion specifications.  `message' returns the
  886.      constructed string.
  887.  
  888.      In batch mode, `message' prints the message text on the standard
  889.      error stream, followed by a newline.
  890.  
  891.      If STRING is `nil', `message' clears the echo area.  If the
  892.      minibuffer is active, this brings the minibuffer contents back onto
  893.      the screen immediately.
  894.  
  895.           (message "Minibuffer depth is %d."
  896.                    (minibuffer-depth))
  897.            -| Minibuffer depth is 0.
  898.           => "Minibuffer depth is 0."
  899.           
  900.           ---------- Echo Area ----------
  901.           Minibuffer depth is 0.
  902.           ---------- Echo Area ----------
  903.  
  904.    Almost all the messages displayed in the echo area are also recorded
  905. in the `*Messages*' buffer.
  906.  
  907.  - User Option: message-log-max
  908.      This variable specifies how many lines to keep in the `*Messages*'
  909.      buffer.  The value `t' means there is no limit on how many lines to
  910.      keep.  The value `nil' disables message logging entirely.  Here's
  911.      how to display a message and prevent it from being logged:
  912.  
  913.           (let (message-log-max)
  914.             (message ...))
  915.  
  916.  - Variable: echo-keystrokes
  917.      This variable determines how much time should elapse before command
  918.      characters echo.  Its value must be an integer, which specifies the
  919.      number of seconds to wait before echoing.  If the user types a
  920.      prefix key (such as `C-x') and then delays this many seconds before
  921.      continuing, the prefix key is echoed in the echo area.  Any
  922.      subsequent characters in the same command will be echoed as well.
  923.  
  924.      If the value is zero, then command input is not echoed.
  925.  
  926.  - Variable: cursor-in-echo-area
  927.      This variable controls where the cursor appears when a message is
  928.      displayed in the echo area.  If it is non-`nil', then the cursor
  929.      appears at the end of the message.  Otherwise, the cursor appears
  930.      at point--not in the echo area at all.
  931.  
  932.      The value is normally `nil'; Lisp programs bind it to `t' for
  933.      brief periods of time.
  934.  
  935. 
  936. File: lispref.info,  Node: Invisible Text,  Next: Selective Display,  Prev: The Echo Area,  Up: Display
  937.  
  938. Invisible Text
  939. ==============
  940.  
  941.    You can make characters "invisible", so that they do not appear on
  942. the screen, with the `invisible' property.  This can be either a text
  943. property or a property of an overlay.
  944.  
  945.    In the simplest case, any non-`nil' `invisible' property makes a
  946. character invisible.  This is the default case--if you don't alter the
  947. default value of `buffer-invisibility-spec', this is how the
  948. `invisibility' property works.  This feature is much like selective
  949. display (*note Selective Display::.), but more general and cleaner.
  950.  
  951.    More generally, you can use the variable `buffer-invisibility-spec'
  952. to control which values of the `invisible' property make text
  953. invisible.  This permits you to classify the text into different subsets
  954. in advance, by giving them different `invisible' values, and
  955. subsequently make various subsets visible or invisible by changing the
  956. value of `buffer-invisibility-spec'.
  957.  
  958.    Controlling visibility with `buffer-invisibility-spec' is especially
  959. useful in a program to display the list of entries in a data base.  It
  960. permits the implementation of convenient filtering commands to view
  961. just a part of the entries in the data base.  Setting this variable is
  962. very fast, much faster than scanning all the text in the buffer looking
  963. for properties to change.
  964.  
  965.  - Variable: buffer-invisibility-spec
  966.      This variable specifies which kinds of `invisible' properties
  967.      actually make a character invisible.
  968.  
  969.     `t'
  970.           A character is invisible if its `invisible' property is
  971.           non-`nil'.  This is the default.
  972.  
  973.     a list
  974.           Each element of the list makes certain characters invisible.
  975.           Ultimately, a character is invisible if any of the elements
  976.           of this list applies to it.  The list can have two kinds of
  977.           elements:
  978.  
  979.          `ATOM'
  980.                A character is invisible if its `invisible' propery value
  981.                is ATOM or if it is a list with ATOM as a member.
  982.  
  983.          `(ATOM . t)'
  984.                A character is invisible if its `invisible' propery value
  985.                is ATOM or if it is a list with ATOM as a member.
  986.                Moreover, if this character is at the end of a line and
  987.                is followed by a visible newline, it displays an
  988.                ellipsis.
  989.  
  990.    Ordinarily, commands that operate on text or move point do not care
  991. whether the text is invisible.  However, the user-level line motion
  992. commands explicitly ignore invisible newlines.
  993.  
  994. 
  995. File: lispref.info,  Node: Selective Display,  Next: Overlay Arrow,  Prev: Invisible Text,  Up: Display
  996.  
  997. Selective Display
  998. =================
  999.  
  1000.    "Selective display" is a pair of features that hide certain lines on
  1001. the screen.
  1002.  
  1003.    The first variant, explicit selective display, is designed for use in
  1004. a Lisp program.  The program controls which lines are hidden by altering
  1005. the text.  Outline mode has traditionally used this variant.  It has
  1006. been partially replaced by the invisible text feature (*note Invisible
  1007. Text::.); there is a new version of Outline mode which uses that
  1008. instead.
  1009.  
  1010.    In the second variant, the choice of lines to hide is made
  1011. automatically based on indentation.  This variant is designed to be a
  1012. user-level feature.
  1013.  
  1014.    The way you control explicit selective display is by replacing a
  1015. newline (control-j) with a carriage return (control-m).  The text that
  1016. was formerly a line following that newline is now invisible.  Strictly
  1017. speaking, it is temporarily no longer a line at all, since only newlines
  1018. can separate lines; it is now part of the previous line.
  1019.  
  1020.    Selective display does not directly affect editing commands.  For
  1021. example, `C-f' (`forward-char') moves point unhesitatingly into
  1022. invisible text.  However, the replacement of newline characters with
  1023. carriage return characters affects some editing commands.  For example,
  1024. `next-line' skips invisible lines, since it searches only for newlines.
  1025. Modes that use selective display can also define commands that take
  1026. account of the newlines, or that make parts of the text visible or
  1027. invisible.
  1028.  
  1029.    When you write a selectively displayed buffer into a file, all the
  1030. control-m's are output as newlines.  This means that when you next read
  1031. in the file, it looks OK, with nothing invisible.  The selective display
  1032. effect is seen only within XEmacs.
  1033.  
  1034.  - Variable: selective-display
  1035.      This buffer-local variable enables selective display.  This means
  1036.      that lines, or portions of lines, may be made invisible.
  1037.  
  1038.         * If the value of `selective-display' is `t', then any portion
  1039.           of a line that follows a control-m is not displayed.
  1040.  
  1041.         * If the value of `selective-display' is a positive integer,
  1042.           then lines that start with more than that many columns of
  1043.           indentation are not displayed.
  1044.  
  1045.      When some portion of a buffer is invisible, the vertical movement
  1046.      commands operate as if that portion did not exist, allowing a
  1047.      single `next-line' command to skip any number of invisible lines.
  1048.      However, character movement commands (such as `forward-char') do
  1049.      not skip the invisible portion, and it is possible (if tricky) to
  1050.      insert or delete text in an invisible portion.
  1051.  
  1052.      In the examples below, we show the *display appearance* of the
  1053.      buffer `foo', which changes with the value of `selective-display'.
  1054.      The *contents* of the buffer do not change.
  1055.  
  1056.           (setq selective-display nil)
  1057.                => nil
  1058.           
  1059.           ---------- Buffer: foo ----------
  1060.           1 on this column
  1061.            2on this column
  1062.             3n this column
  1063.             3n this column
  1064.            2on this column
  1065.           1 on this column
  1066.           ---------- Buffer: foo ----------
  1067.           
  1068.           (setq selective-display 2)
  1069.                => 2
  1070.           
  1071.           ---------- Buffer: foo ----------
  1072.           1 on this column
  1073.            2on this column
  1074.            2on this column
  1075.           1 on this column
  1076.           ---------- Buffer: foo ----------
  1077.  
  1078.  - Variable: selective-display-ellipses
  1079.      If this buffer-local variable is non-`nil', then XEmacs displays
  1080.      `...' at the end of a line that is followed by invisible text.
  1081.      This example is a continuation of the previous one.
  1082.  
  1083.           (setq selective-display-ellipses t)
  1084.                => t
  1085.           
  1086.           ---------- Buffer: foo ----------
  1087.           1 on this column
  1088.            2on this column ...
  1089.            2on this column
  1090.           1 on this column
  1091.           ---------- Buffer: foo ----------
  1092.  
  1093.      You can use a display table to substitute other text for the
  1094.      ellipsis (`...').  *Note Display Tables::.
  1095.  
  1096. 
  1097. File: lispref.info,  Node: Overlay Arrow,  Next: Temporary Displays,  Prev: Selective Display,  Up: Display
  1098.  
  1099. The Overlay Arrow
  1100. =================
  1101.  
  1102.    The "overlay arrow" is useful for directing the user's attention to
  1103. a particular line in a buffer.  For example, in the modes used for
  1104. interface to debuggers, the overlay arrow indicates the line of code
  1105. about to be executed.
  1106.  
  1107.  - Variable: overlay-arrow-string
  1108.      This variable holds the string to display to call attention to a
  1109.      particular line, or `nil' if the arrow feature is not in use.
  1110.      Despite its name, the value of this variable can be either a string
  1111.      or a glyph (*note Glyphs::.).
  1112.  
  1113.  - Variable: overlay-arrow-position
  1114.      This variable holds a marker that indicates where to display the
  1115.      overlay arrow.  It should point at the beginning of a line.  The
  1116.      arrow text appears at the beginning of that line, overlaying any
  1117.      text that would otherwise appear.  Since the arrow is usually
  1118.      short, and the line usually begins with indentation, normally
  1119.      nothing significant is overwritten.
  1120.  
  1121.      The overlay string is displayed only in the buffer that this marker
  1122.      points into.  Thus, only one buffer can have an overlay arrow at
  1123.      any given time.
  1124.  
  1125.    You can do the same job by creating an extent with a `begin-glyph'
  1126. property.  *Note Extent Properties::.
  1127.  
  1128. 
  1129. File: lispref.info,  Node: Temporary Displays,  Next: Blinking,  Prev: Overlay Arrow,  Up: Display
  1130.  
  1131. Temporary Displays
  1132. ==================
  1133.  
  1134.    Temporary displays are used by commands to put output into a buffer
  1135. and then present it to the user for perusal rather than for editing.
  1136. Many of the help commands use this feature.
  1137.  
  1138.  - Special Form: with-output-to-temp-buffer BUFFER-NAME FORMS...
  1139.      This function executes FORMS while arranging to insert any output
  1140.      they print into the buffer named BUFFER-NAME.  The buffer is then
  1141.      shown in some window for viewing, displayed but not selected.
  1142.  
  1143.      The string BUFFER-NAME specifies the temporary buffer, which need
  1144.      not already exist.  The argument must be a string, not a buffer.
  1145.      The buffer is erased initially (with no questions asked), and it is
  1146.      marked as unmodified after `with-output-to-temp-buffer' exits.
  1147.  
  1148.      `with-output-to-temp-buffer' binds `standard-output' to the
  1149.      temporary buffer, then it evaluates the forms in FORMS.  Output
  1150.      using the Lisp output functions within FORMS goes by default to
  1151.      that buffer (but screen display and messages in the echo area,
  1152.      although they are "output" in the general sense of the word, are
  1153.      not affected).  *Note Output Functions::.
  1154.  
  1155.      The value of the last form in FORMS is returned.
  1156.  
  1157.           ---------- Buffer: foo ----------
  1158.            This is the contents of foo.
  1159.           ---------- Buffer: foo ----------
  1160.           
  1161.           (with-output-to-temp-buffer "foo"
  1162.               (print 20)
  1163.               (print standard-output))
  1164.           => #<buffer foo>
  1165.           
  1166.           ---------- Buffer: foo ----------
  1167.           20
  1168.           
  1169.           #<buffer foo>
  1170.           
  1171.           ---------- Buffer: foo ----------
  1172.  
  1173.  - Variable: temp-buffer-show-function
  1174.      If this variable is non-`nil', `with-output-to-temp-buffer' calls
  1175.      it as a function to do the job of displaying a help buffer.  The
  1176.      function gets one argument, which is the buffer it should display.
  1177.  
  1178.      In Emacs versions 18 and earlier, this variable was called
  1179.      `temp-buffer-show-hook'.
  1180.  
  1181.  - Function: momentary-string-display STRING POSITION &optional CHAR
  1182.           MESSAGE
  1183.      This function momentarily displays STRING in the current buffer at
  1184.      POSITION.  It has no effect on the undo list or on the buffer's
  1185.      modification status.
  1186.  
  1187.      The momentary display remains until the next input event.  If the
  1188.      next input event is CHAR, `momentary-string-display' ignores it
  1189.      and returns.  Otherwise, that event remains buffered for
  1190.      subsequent use as input.  Thus, typing CHAR will simply remove the
  1191.      string from the display, while typing (say) `C-f' will remove the
  1192.      string from the display and later (presumably) move point forward.
  1193.      The argument CHAR is a space by default.
  1194.  
  1195.      The return value of `momentary-string-display' is not meaningful.
  1196.  
  1197.      You can do the same job in a more general way by creating an extent
  1198.      with a begin-glyph property.  *Note Extent Properties::.
  1199.  
  1200.      If MESSAGE is non-`nil', it is displayed in the echo area while
  1201.      STRING is displayed in the buffer.  If it is `nil', a default
  1202.      message says to type CHAR to continue.
  1203.  
  1204.      In this example, point is initially located at the beginning of the
  1205.      second line:
  1206.  
  1207.           ---------- Buffer: foo ----------
  1208.           This is the contents of foo.
  1209.           -!-Second line.
  1210.           ---------- Buffer: foo ----------
  1211.           
  1212.           (momentary-string-display
  1213.             "**** Important Message! ****"
  1214.             (point) ?\r
  1215.             "Type RET when done reading")
  1216.           => t
  1217.           
  1218.           ---------- Buffer: foo ----------
  1219.           This is the contents of foo.
  1220.           **** Important Message! ****Second line.
  1221.           ---------- Buffer: foo ----------
  1222.           
  1223.           ---------- Echo Area ----------
  1224.           Type RET when done reading
  1225.           ---------- Echo Area ----------
  1226.  
  1227.      This function works by actually changing the text in the buffer.
  1228.      As a result, if you later undo in this buffer, you will see the
  1229.      message come and go.
  1230.  
  1231.